home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Views / Panes / Pane.h < prev    next >
Text File  |  2000-06-23  |  1KB  |  58 lines

  1. // Pane.h
  2.  
  3. #ifndef Pane_h
  4. #define Pane_h
  5.  
  6. #ifndef ListLink_h
  7. #include "ListLink.h"
  8. #endif
  9. #ifndef DrawsSpontaneously_h
  10. #include "DrawsSpontaneously.h"
  11. #endif
  12. #ifndef View_h
  13. #include "View.h"
  14. #endif
  15.  
  16. class CellVisitor;
  17. class Canvas;
  18.  
  19. class Pane 
  20.   {
  21.     friend class CanvasLoopBase;
  22.     
  23.     private:
  24.         const DrawsSpontaneously *parent;
  25.         View *content;
  26.         ListLink<Pane> viewLink;    // Panes which share our view
  27.         
  28.         void SetContent( View& view, DrawsSpontaneously * );
  29.         
  30.         // not implemented:
  31.             Pane( const Pane& );
  32.             void operator=( const Pane& );
  33.     
  34.     protected:
  35.         void SetParent( const DrawsSpontaneously *p )    { parent = p; }
  36.     
  37.     public:
  38.         explicit Pane( const DrawsSpontaneously *parent = 0 );
  39.         ~Pane();
  40.  
  41.         void Clear();
  42.         
  43.         virtual void SetContent( View& view )
  44.             { SetContent( view, dynamic_cast<DrawsSpontaneously*>(&view) ); }
  45.         
  46.         void Deliver( CellVisitor&,
  47.                           const Canvas& parentCanvas,
  48.                           Canvas& scratchCanvas ) const;
  49.         
  50.         View& Content() const                                    { return *content; }
  51.         
  52.         const DrawsSpontaneously *Parent() const            { return parent; }
  53.         
  54.         virtual void Adjust( Canvas& ) const = 0;
  55.   };
  56.  
  57. #endif
  58.